# D盘下有一个文本文件d.txt，内容包括大小写字母，
# 将d.txt文件中小写字母保存到另外一个文件new_D.txt中
with open(r'd:/d.txt', 'r') as f:
    result = f.read()
for temp in result:
    # 判断字母是否为大写
    if temp.isupper():
        pass
    else:
        # a为追加的模式，代+号表示可读可写
        with open(r'd:/new_d.txt', 'a+') as f:
            f.write(temp)
